package gewu.suleju.dao.iml;

import gewu.suleju.model.pojo.BrokerAgentHouse;
import gewu.suleju.model.pojo.HouseInfor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface IBrokerAgentHouseDao  extends JpaRepository<HouseInfor,Integer> {
    //未出租
    @Query(value="select * from house_infor where id in (select house_infor_id from broker_agent_house where is_status=0 and broker_info_id=?1)",nativeQuery = true)
    List<HouseInfor> findHouseIng(Integer id);
    //已出租
    @Query(value="select * from house_infor where id in (select house_infor_id from broker_agent_house where is_status=1 and broker_info_id=?1)",nativeQuery = true)
    List<HouseInfor> findHouseEnd(Integer id);
}
